<?php include("conn.php");?>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<?php include("public/cssjs.php");?>
<title>栏目设置</title>
</head>
<body>
<div class="page-container">
	<form action="" method="post" class="form form-horizontal" id="form-category-add" name="form1">
		<div id="tab-category" class="HuiTab">
			<div class="tabBar cl">
				<span>基本设置</span>
				<span>图片设置</span>
				<span>SEO设置</span>
			</div>
			<div class="tabCon">
				
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">
						<span class="c-red">*</span>
						上级栏目：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<span class="select-box">
						<select class="select" id="sel_Sub" name="sel_Sub" onchange="SetSubID(this);">
							<option value="0">顶级分类</option>
							<? ShowSelect(0,"newscata_product",$Mcataid,6,true) ?>
						</select>
						</span>
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">
						<span class="c-red">*</span>
						分类名称：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text"  placeholder="栏目名称" id="title" name="title">
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">栏目简述：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" placeholder="" id="title_f" name="title_f">
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">栏目跳转：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" placeholder="" id="JumpUrl" name="JumpUrl">
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">内容类型：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<span class="select-box">
						<select name="InfoType" id="InfoType" class="select">
							<option value="InAll">文章</option>
                            <option value="News">列表</option>
							<option value="SImg">图片</option>
							<option value="TImg">专题</option>
							
						</select>
						</span>
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">是否有下级：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<div class="radio-box">
					<input name="xiaji" type="radio" value="1" id="xiaji-1" checked>
					<label for="xiaji-1">是</label>
				</div>
				<div class="radio-box">
					<input type="radio" id="xiaji-2" value="0" name="xiaji">
					<label for="xiaji-2">否</label>
				</div>
				
			</div>
            
			</div>
            <div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">是否推荐：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<div class="radio-box">
					<input name="recc" type="radio" value="1" id="recc-1" >
					<label for="recc-1">是</label>
				</div>
				<div class="radio-box">
					<input type="radio" id="recc-2" value="0" name="recc" checked>
					<label for="recc-2">否</label>
				</div>
				
			</div>
		</div>
        </div>
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">栏目LOGO：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<iframe 
      src="../pic/images_UP.php?bd=a1_img&form=form1" name="key" width="448" 
      height="30" marginheight="0" scrolling="No" frameborder="0" id="key">IE</iframe>
      <input type="text" name="a1_img" id="a1_img" class="input-text"  size="60">
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">栏目banner：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<iframe 
      src="../pic/images_UP.php?bd=a2_img&form=form1" name="key" width="448" 
      height="30" marginheight="0" scrolling="No" frameborder="0" id="key">IE</iframe>
      <input type="text" name="a2_img" id="a2_img" class="input-text"  size="60">
					</div>
					<div class="col-3">
					</div>
				</div>
                <div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">栏目wap-banner：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<iframe 
      src="../pic/images_UP.php?bd=a3_img&form=form1" name="key" width="448" 
      height="30" marginheight="0" scrolling="No" frameborder="0" id="key">IE</iframe>
      <input type="text" name="a3_img" id="a3_img" class="input-text"  size="60">
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">每页显示多少条：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="20" style="width:200px;" id="tp" name="tp">
					</div>
					<div class="col-3">
					</div>
				</div>
			</div>
			<div class="tabCon">
           	 	<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">静态化目录：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" name="dirpath" id="dirpath">
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">网页标题：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" name="ttitle" id="ttitle">
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">关键词：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" name="tkeyword" id="tkeyword">
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">描述：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<textarea name="tdescription" id="tdescription" cols="" rows="" class="textarea"  placeholder="说点什么...最少输入10个字符" datatype="*10-100" dragonfly="true" nullmsg="备注不能为空！" onKeyUp="$.Huitextarealength(this,100)"></textarea>
						<p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
					</div>
					<div class="col-3">
					</div>
				</div>
			</div>
		</div>
		<div class="row cl">
			<div class="col-9 col-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/h-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/h-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#tab-category").Huitab({
		index:0
	});
	$("#form-category-add").validate({
		rules:{
			title:{
				required:true
			}
			
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			var sel_Sub=$("#sel_Sub").val();
			var title=$("#title").val();
			var title_f=$("#title_f").val();
			var JumpUrl=$("#JumpUrl").val();
			var InfoType=$("#InfoType").val();
			var tpic=$("#tp").val();
			var ttitle=$("#ttitle").val();
			var tkeyword=$("#tkeyword").val();
			var tdescription=$("#tdescription").val();
			var xiaji=$('input[name="xiaji"]').val();
			var tlogo=$("#a1_img").val();
			var tbanner=$("#a2_img").val();
			var tbanner2=$("#a3_img").val();
			var recc=$('input[name="recc"]').val();
			var dirpath=$("#dirpath").val();
			 $.ajax({
				type:"POST",
				url:"json/procata.php" ,
				data:{'sel_Sub':sel_Sub,'title':title,'title_f':title_f,'JumpUrl':JumpUrl,'InfoType':InfoType,'tpic':tpic,'ttitle':ttitle,'tkeyword':tkeyword,'tdescription':tdescription,'xiaji':xiaji,'logo':tlogo,'banner':tbanner,'banner2':tbanner2,'recc':recc,'dirpath':dirpath,'Type':'add'},
				datatype: "json",    
				success:function(data){
					if(data==1){
						layer.msg('添加成功!',{icon:1,time:1000});
						var index=parent.layer.getFrameIndex(window.name);
						
						window.parent.location.reload();
						parent.layer.close(index);
						}else{
						layer.msg('系统错误error!',{icon:1,time:1000});	
							}
				}
			});
			
		}
	});
});

</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>